package com.tmt.im.common.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tmt.im.common.annotation._AllowUpdate;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.ignite.cache.query.annotations.QuerySqlField;

import java.io.Serial;
import java.sql.Timestamp;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/9/2 17:58
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class PersonalSettingPoJo implements IGetKey<Long> {

    @Serial
    private static final long serialVersionUID = 1194032697806979861L;

    public static final String CACHE_NAME = "personal_setting";

    @QuerySqlField(name = "id", index = true)
    private Long id;

    /**
     * 是否开启免打扰
     */
    @QuerySqlField(name = "enable_new_msg_notify")
    @_AllowUpdate
    private boolean enableNewMsgNotify = true;

    /**
     * 新消息到达是否有声音提示。
     */
    @QuerySqlField(name = "enable_sound_hint")
    @_AllowUpdate
    private boolean enableSoundHint = true;

    /**
     * 新消息到达是否有震动提示。
     */
    @QuerySqlField(name = "enable_shock_hint")
    @_AllowUpdate
    private boolean enableShockHint = true;

    /**
     * 是否允许申请加我为好友。
     */
    @QuerySqlField(name = "enable_add_friend")
    @_AllowUpdate
    private boolean enableAddFriend = true;


    @QuerySqlField(name = "review_on_adding_friend")
    @_AllowUpdate
    private boolean reviewOnAddingFriend = true;

    /**
     * 允许加好友的方式
     */
    @QuerySqlField(name = "add_friend_modes")
    @_AllowUpdate
    private String addFriendModes;

    /**
     * 配置的拥有者
     */
    @QuerySqlField(name = "owner_id")
    private Long ownerId;

    @QuerySqlField(name = "create_time")
    private Timestamp createTime;

    @JsonIgnore
    private boolean insert;

    @Override
    public Long getKey() {
        return id;
    }
}

